/*     */ package com.jcraft.jzlib;
/*     */ 
/*     */ import java.io.PrintStream;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public final class ZStream
/*     */ {
/*     */   private static final int MAX_WBITS = 15;
/*     */   private static final int DEF_WBITS = 15;
/*     */   private static final int Z_NO_FLUSH = 0;
/*     */   private static final int Z_PARTIAL_FLUSH = 1;
/*     */   private static final int Z_SYNC_FLUSH = 2;
/*     */   private static final int Z_FULL_FLUSH = 3;
/*     */   private static final int Z_FINISH = 4;
/*     */   private static final int MAX_MEM_LEVEL = 9;
/*     */   private static final int Z_OK = 0;
/*     */   private static final int Z_STREAM_END = 1;
/*     */   private static final int Z_NEED_DICT = 2;
/*     */   private static final int Z_ERRNO = -1;
/*     */   private static final int Z_STREAM_ERROR = -2;
/*     */   private static final int Z_DATA_ERROR = -3;
/*     */   private static final int Z_MEM_ERROR = -4;
/*     */   private static final int Z_BUF_ERROR = -5;
/*     */   private static final int Z_VERSION_ERROR = -6;
/*     */   public byte[] next_in;
/*     */   public int next_in_index;
/*     */   public int avail_in;
/*     */   public long total_in;
/*     */   public byte[] next_out;
/*     */   public int next_out_index;
/*     */   public int avail_out;
/*     */   public long total_out;
/*     */   public String msg;
/*     */   Deflate dstate;
/*     */   Inflate istate;
/*     */   int data_type;
/*     */   public long adler;
/*  78 */   Adler32 _adler = new Adler32();
/*     */   
/*     */   public int inflateInit() {
/*  81 */     return inflateInit(15);
/*     */   }
/*     */   
/*     */   public int inflateInit(boolean nowrap) {
/*  85 */     return inflateInit(15, nowrap);
/*     */   }
/*     */   
/*     */   public int inflateInit(int w) {
/*  89 */     return inflateInit(w, false);
/*     */   }
/*     */   
/*     */   public int inflateInit(int w, boolean nowrap) {
/*  93 */     this.istate = new Inflate();
/*  94 */     return this.istate.inflateInit(this, nowrap ? -w : w);
/*     */   }
/*     */   
/*     */   public int inflate(int f) {
/*  98 */     if (this.istate == null)
/*  99 */       return -2;
/* 100 */     return this.istate.inflate(this, f);
/*     */   }
/*     */   
/*     */   public int inflateEnd() {
/* 104 */     if (this.istate == null)
/* 105 */       return -2;
/* 106 */     int ret = this.istate.inflateEnd(this);
/* 107 */     this.istate = null;
/* 108 */     return ret;
/*     */   }
/*     */   
/*     */   public int inflateSync() {
/* 112 */     if (this.istate == null)
/* 113 */       return -2;
/* 114 */     return this.istate.inflateSync(this);
/*     */   }
/*     */   
/*     */   public int inflateSetDictionary(byte[] dictionary, int dictLength) {
/* 118 */     if (this.istate == null)
/* 119 */       return -2;
/* 120 */     return this.istate.inflateSetDictionary(this, dictionary, dictLength);
/*     */   }
/*     */   
/*     */   public int deflateInit(int level) {
/* 124 */     return deflateInit(level, 15);
/*     */   }
/*     */   
/*     */   public int deflateInit(int level, boolean nowrap) {
/* 128 */     return deflateInit(level, 15, nowrap);
/*     */   }
/*     */   
/*     */   public int deflateInit(int level, int bits) {
/* 132 */     return deflateInit(level, bits, false);
/*     */   }
/*     */   
/*     */   public int deflateInit(int level, int bits, boolean nowrap) {
/* 136 */     this.dstate = new Deflate();
/* 137 */     return this.dstate.deflateInit(this, level, nowrap ? -bits : bits);
/*     */   }
/*     */   
/*     */   public int deflate(int flush) {
/* 141 */     if (this.dstate == null) {
/* 142 */       return -2;
/*     */     }
/* 144 */     return this.dstate.deflate(this, flush);
/*     */   }
/*     */   
/*     */   public int deflateEnd() {
/* 148 */     if (this.dstate == null)
/* 149 */       return -2;
/* 150 */     int ret = this.dstate.deflateEnd();
/* 151 */     this.dstate = null;
/* 152 */     return ret;
/*     */   }
/*     */   
/*     */   public int deflateParams(int level, int strategy) {
/* 156 */     if (this.dstate == null)
/* 157 */       return -2;
/* 158 */     return this.dstate.deflateParams(this, level, strategy);
/*     */   }
/*     */   
/*     */   public int deflateSetDictionary(byte[] dictionary, int dictLength) {
/* 162 */     if (this.dstate == null)
/* 163 */       return -2;
/* 164 */     return this.dstate.deflateSetDictionary(this, dictionary, dictLength);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   void flush_pending()
/*     */   {
/* 172 */     int len = this.dstate.pending;
/*     */     
/* 174 */     if (len > this.avail_out)
/* 175 */       len = this.avail_out;
/* 176 */     if (len == 0) {
/* 177 */       return;
/*     */     }
/* 179 */     if ((this.dstate.pending_buf.length <= this.dstate.pending_out) || 
/* 180 */       (this.next_out.length <= this.next_out_index) || 
/* 181 */       (this.dstate.pending_buf.length < this.dstate.pending_out + len) || 
/* 182 */       (this.next_out.length < this.next_out_index + len)) {
/* 183 */       System.out.println(this.dstate.pending_buf.length + ", " + 
/* 184 */         this.dstate.pending_out + ", " + this.next_out.length + ", " + 
/* 185 */         this.next_out_index + ", " + len);
/* 186 */       System.out.println("avail_out=" + this.avail_out);
/*     */     }
/*     */     
/* 189 */     System.arraycopy(this.dstate.pending_buf, this.dstate.pending_out, this.next_out, 
/* 190 */       this.next_out_index, len);
/*     */     
/* 192 */     this.next_out_index += len;
/* 193 */     this.dstate.pending_out += len;
/* 194 */     this.total_out += len;
/* 195 */     this.avail_out -= len;
/* 196 */     this.dstate.pending -= len;
/* 197 */     if (this.dstate.pending == 0) {
/* 198 */       this.dstate.pending_out = 0;
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   int read_buf(byte[] buf, int start, int size)
/*     */   {
/* 208 */     int len = this.avail_in;
/*     */     
/* 210 */     if (len > size)
/* 211 */       len = size;
/* 212 */     if (len == 0) {
/* 213 */       return 0;
/*     */     }
/* 215 */     this.avail_in -= len;
/*     */     
/* 217 */     if (this.dstate.noheader == 0) {
/* 218 */       this.adler = this._adler.adler32(this.adler, this.next_in, this.next_in_index, len);
/*     */     }
/* 220 */     System.arraycopy(this.next_in, this.next_in_index, buf, start, len);
/* 221 */     this.next_in_index += len;
/* 222 */     this.total_in += len;
/* 223 */     return len;
/*     */   }
/*     */   
/*     */   public void free() {
/* 227 */     this.next_in = null;
/* 228 */     this.next_out = null;
/* 229 */     this.msg = null;
/* 230 */     this._adler = null;
/*     */   }
/*     */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\com\jcraft\jzlib\ZStream.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */